<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.2.0/turbolinks.js" integrity="sha256-iM4Yzi/zLj/IshPWMC1IluRxTtRjMqjPGd97TZ9yYpU=" crossorigin="anonymous"></script>
  <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
  <link rel="shortcut icon" type="image/png" href="/favicon.png">

  <link rel="stylesheet" href="/css/style.css">
  <link rel="stylesheet" href="/css/css/fontawesome-all.min.css">
  <link rel="stylesheet" href="/css/css/work-sans-v7.css">
  <script src="/js/main.js"></script>

  <!-- Begin Jekyll SEO tag v2.6.1 -->
<title>Converting VESTS to STEEM | Hive Developer</title>
<meta name="generator" content="Jekyll v4.0.0" />
<meta property="og:title" content="Converting VESTS to STEEM" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="How to convert VESTS to STEEM or STEEM POWER" />
<meta property="og:description" content="How to convert VESTS to STEEM or STEEM POWER" />
<link rel="canonical" href="vest-to-steem.html" />
<meta property="og:url" content="vest-to-steem.html" />
<meta property="og:site_name" content="Hive Developer" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2020-08-26T11:52:22-07:00" />
<script type="application/ld+json">
{"description":"How to convert VESTS to STEEM or STEEM POWER","mainEntityOfPage":{"@type":"WebPage","@id":"vest-to-steem.html"},"@type":"BlogPosting","url":"vest-to-steem.html","headline":"Converting VESTS to STEEM","dateModified":"2020-08-26T11:52:22-07:00","datePublished":"2020-08-26T11:52:22-07:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->


  
</head>
<body>
<header>
  <h1>
    <button type="button" class="open-nav" id="open-nav"></button>
    <a href="/"  class="logo-link"><img src="/images/logotype_black.svg" height="40" alt="Hive Developer logo"></a>
  </h1>

  
  <form action="/search/" method="get">
    <input type="text" name="q" id="search-input" placeholder="Search">
    <input type="submit" value="Search" style="display: none;">
  </form>
  

  <div id="sidebar" class="sidebar">
	
	
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/">
		<h6 class="ctrl-nav-section title">Introduction</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/#introduction-welcome">Welcome to Hive</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/quickstart/">
		<h6 class="ctrl-nav-section title">Quickstart</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/quickstart/#quickstart-choose-library">Choose Library</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-hive-full-nodes">Hive Nodes</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-testnet">Hive Testnet</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/tutorials/">
		<h6 class="ctrl-nav-section title">Tutorials</h6>
		<ul class="cont-nav-section content">
			
				
					
						<li><a href="/tutorials/#tutorials-javascript">Javascript</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-python">Python</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-ruby">Ruby</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-recipes">Recipes</a></li>
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/services/">
		<h6 class="ctrl-nav-section title">Services</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/services/#services-hive-blog">hive.blog</a></li>
						
					
						
						<li><a href="/services/#services-hivesigner">HiveSigner</a></li>
						
					
						
						<li><a href="/services/#services-jussi">Jussi</a></li>
						
					
						
						<li><a href="/services/#services-imagehoster">ImageHoster</a></li>
						
					
						
						<li><a href="/services/#services-dhf">DHF</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/apidefinitions/">
		<h6 class="ctrl-nav-section title">Appbase API</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/apidefinitions/#apidefinitions-condenser-api">Condenser Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-bridge">Bridge</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-by-key-api">Account By Key Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-history-api">Account History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-block-api">Block Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-database-api">Database Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-debug-node-api">Debug Node Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-follow-api">Follow Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-jsonrpc">Jsonrpc</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-market-history-api">Market History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-network-broadcast-api">Network Broadcast Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-rc-api">Rc Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-reputation-api">Reputation Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-rewards-api">Rewards Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-tags-api">Tags Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-transaction-status-api">Transaction Status Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-witness-api">Witness Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops">Broadcast Ops</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops-communities">Broadcast Ops Communities</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/resources/">
		<h6 class="ctrl-nav-section title">Resources</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/resources/#resources-overview">Overview</a></li>
						
					
						
						<li><a href="/resources/#resources-client-libs">Client Libraries</a></li>
						
					
						
						<li><a href="/resources/#resources-bluepaper">Bluepaper</a></li>
						
					
						
						<li><a href="/resources/#resources-whitepaper">Whitepaper</a></li>
						
					
						
						<li><a href="/resources/#resources-tools">Tools</a></li>
						
					
						
						<li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
						
					
						
						<li><a href="/resources/#resources-hive-keychain">Hive Keychain</a></li>
						
					
						
						<li><a href="/resources/#resources-developeradvocate">Community & Help</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/glossary/">
		<h6 class="ctrl-nav-section title">Glossary</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/glossary/#glossary-chain-basics">Chain Basics</a></li>
						
					
						
					
						
						<li><a href="/glossary/#glossary-governance">Governance</a></li>
						
					
						
						<li><a href="/glossary/#glossary-transactions">Transactions</a></li>
						
					
						
						<li><a href="/glossary/#glossary-api">API</a></li>
						
					
						
						<li><a href="/glossary/#glossary-market">Market</a></li>
						
					
				
			
		</ul>
	</section>
	
</div>



  <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</header>
<div class="main" id="top">
  <div class="hero">
    <h1 class="hero__h1">Hive Developer Portal </h1>
    <img class="hero__img" src="/images/honey-comb-92.png" style="position: relative; top: 10px;" />
  </div>
  <section id="tutorials-recipes-vest-to-steem" class="row tutorials-recipes-vest-to-steem">
	<h3>
		<a id="tutorials-recipes-vest-to-steem">
			Converting VESTS to STEEM
			
		</a>
	</h3>
	
		<span class="description"><p>How to convert VESTS to STEEM or STEEM POWER</p>
</span>
	

	<h3 id="intro">Intro</h3>

<p>Steem’s has base unit is VESTS and usually user doesn’t know about this unit because everything is dynamically calucated and presented in STEEM form for convenience of the user. In this recipe we will talk about how converting is working behind the scenes on all Steem apps. Dynamic Global Properties are used in this recipe to fetch the current values of global blockchain properties.</p>

<h2 id="steps">Steps</h2>

<ol>
  <li><a href="#get-global"><strong>Get Dynamic Global Properties</strong></a> Fetch current values of global blockchain properties</li>
  <li><a href="#formula"><strong>Formulate VESTS_TO_STEEM</strong></a> Formulate function that will convert given VESTS to STEEM.</li>
</ol>

<h4 id="1-get-dynamic-global-properties-">1. Get Dynamic Global Properties <a name="get-global"></a></h4>

<p>Following method can be used to fetch global values</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="nt">--data</span> <span class="s1">'{"jsonrpc":"2.0", "method":"condenser_api.get_dynamic_global_properties", "params":[], "id":1}'</span> https://api.steemit.com
</code></pre></div></div>

<h5 id="example-output">Example Output<a style="float: right" href="#steps"><i class="fas fa-chevron-up fa-sm"></i></a></h5>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
   </span><span class="nl">"id"</span><span class="p">:</span><span class="mi">1</span><span class="p">,</span><span class="w">
   </span><span class="nl">"jsonrpc"</span><span class="p">:</span><span class="s2">"2.0"</span><span class="p">,</span><span class="w">
   </span><span class="nl">"result"</span><span class="p">:{</span><span class="w">
      </span><span class="nl">"head_block_number"</span><span class="p">:</span><span class="mi">24238248</span><span class="p">,</span><span class="w">
      </span><span class="nl">"head_block_id"</span><span class="p">:</span><span class="s2">"0171d8a833dc369abd034b0c67d8725f96df9e5b"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"time"</span><span class="p">:</span><span class="s2">"2018-07-16T22:41:24"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"current_witness"</span><span class="p">:</span><span class="s2">"xeldal"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"total_pow"</span><span class="p">:</span><span class="mi">514415</span><span class="p">,</span><span class="w">
      </span><span class="nl">"num_pow_witnesses"</span><span class="p">:</span><span class="mi">172</span><span class="p">,</span><span class="w">
      </span><span class="nl">"virtual_supply"</span><span class="p">:</span><span class="s2">"283434761.199 STEEM"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"current_supply"</span><span class="p">:</span><span class="s2">"271729171.190 STEEM"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"confidential_supply"</span><span class="p">:</span><span class="s2">"0.000 STEEM"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"current_sbd_supply"</span><span class="p">:</span><span class="s2">"15498201.173 SBD"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"confidential_sbd_supply"</span><span class="p">:</span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"total_vesting_fund_steem"</span><span class="p">:</span><span class="s2">"192913644.627 STEEM"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"total_vesting_shares"</span><span class="p">:</span><span class="s2">"391296886352.617261 VESTS"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"total_reward_fund_steem"</span><span class="p">:</span><span class="s2">"0.000 STEEM"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"total_reward_shares2"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"pending_rewarded_vesting_shares"</span><span class="p">:</span><span class="s2">"379159224.860656 VESTS"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"pending_rewarded_vesting_steem"</span><span class="p">:</span><span class="s2">"185294.019 STEEM"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"sbd_interest_rate"</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span><span class="w">
      </span><span class="nl">"sbd_print_rate"</span><span class="p">:</span><span class="mi">2933</span><span class="p">,</span><span class="w">
      </span><span class="nl">"maximum_block_size"</span><span class="p">:</span><span class="mi">65536</span><span class="p">,</span><span class="w">
      </span><span class="nl">"current_aslot"</span><span class="p">:</span><span class="mi">24315228</span><span class="p">,</span><span class="w">
      </span><span class="nl">"recent_slots_filled"</span><span class="p">:</span><span class="s2">"340282366920938463463374607431768211400"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"participation_count"</span><span class="p">:</span><span class="mi">128</span><span class="p">,</span><span class="w">
      </span><span class="nl">"last_irreversible_block_num"</span><span class="p">:</span><span class="mi">24238230</span><span class="p">,</span><span class="w">
      </span><span class="nl">"vote_power_reserve_rate"</span><span class="p">:</span><span class="mi">10</span><span class="p">,</span><span class="w">
      </span><span class="nl">"average_block_size"</span><span class="p">:</span><span class="mi">10950</span><span class="p">,</span><span class="w">
      </span><span class="nl">"current_reserve_ratio"</span><span class="p">:</span><span class="mi">200000000</span><span class="p">,</span><span class="w">
      </span><span class="nl">"max_virtual_bandwidth"</span><span class="p">:</span><span class="s2">"264241152000000000000"</span><span class="w">
   </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<h4 id="2-formulate-vests_to_steem-">2. Formulate VESTS_TO_STEEM <a name="formula"></a><a style="float: right" href="#steps"><i class="fas fa-chevron-up fa-sm"></i></a></h4>

<p>From above results we have everything we need to calculate STEEM from given VESTS value.</p>

<p>Let’s say we have been given <code class="highlighter-rouge">availableVESTS</code> variable, value in VESTS and we want to convert that to STEEM. By using values from above returned object our formula would be as follows:</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>vestSteem = ( result.total_vesting_fund_steem x availableVESTS ) / result.total_vesting_shares
</code></pre></div></div>

<p>That’s it!</p>

</section>

</div>
<div class="footer">
  <a href="#">Back to top</a>
</div>
<script>
    document.getElementById("open-nav").addEventListener("click", function () {
        document.body.classList.toggle("nav-open");
    });
</script>
</body>
</html>


<script src="/js/adjust.js"></script>

